Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factorize the code to make it easier to add new modes AND added a Juxtalinear edition mode #303

Merged
merged 54 commits into from
Jun 14, 2024

Conversation

DanielC-N
Copy link
Contributor

  • added a Juxta mode that creates a translation burrito

  • added a 'factoryCreateContent.js' file to help factorize some code for 'createObsContent', 'createVersificationUSFM' and 'createAudioVersification' in 'saveProjetcsMeta.js'

  • fixing some typos, fixing lint

- added a 'factoryCreateContent.js'  file to help factorize some code for 'createObsContent', 'createVersificationUSFM' and 'createAudioVersification' in 'saveProjetcsMeta.js'

- fixing some typos, fixing lint
@DanielC-N
Copy link
Contributor Author

First thing first I've added comments, where I did (or intend to) add code. But I've annotated it with "Nicolas" and sometimes I've added some questions with it.
If you can answer the questions, or have a comment on my annotation or if I'm doing something wrong, please let me know!

@selvabenz
Copy link

selvabenz commented Jan 17, 2024

@DanielC-N App is breaking, could you check? Could not move further.

image

CSS fix required: Icon is visible only on hover.

image

@DanielC-N
Copy link
Contributor Author

@selvabenz I forgot to mention that it is not yet intended to be build. "As is" it'll definitely not work since I'm still modifying the code as I'm asking questions. It's only on the code part that I need help.
Sorry for the misunderstanding.

ps : I'm terrible at css, how may I fix this Icon issue?

@DanielC-N
Copy link
Contributor Author

@selvabenz I've updated the code so it can work properly

@selvabenz
Copy link

Hi @DanielC-N thanks for updating the code. It is working fine. Juxta mode creates the projects under Text Translation flavour is that what you have intended? Have you added the Juxta feature in this Pr?

image

danielc-n added 3 commits February 2, 2024 10:26
… to search and download a SB as a resource in a module
- auto load a book on the opening of a project
- auto save after a modification
- fixed a bit of typos and code
@DanielC-N
Copy link
Contributor Author

@selvabenz

I've modified the code in order to fully work with Juxta files. Now a project is correctly labeled as "Juxtalinear" (along with the flavour)

I've some juxtalinear JSON files for the tests here :

PHP.json
TIT.json

@DanielC-N
Copy link
Contributor Author

DanielC-N commented Feb 21, 2024

@selvabenz
I've updated the code and it's working properly now. You can create a juxtalinear project by importing your own usfms. You must use greek/hebrew usfm for now.. It's correctly listed as a "Juxtalinear" flavor. When you open the project it'll open the Juxtalinear Editor.
Here's the video of the demo usage : https://youtu.be/sarZnbxbgDY

Here's some usfm files that you can import to test the mode :
2JN.txt
PHP.txt
TIT.txt

@DanielC-N
Copy link
Contributor Author

I'm still working on the performances to load a file. For example : the book of revelation in usfm takes 10~15 sec to load for now.

…t was throwing an error when a user where to search for a resource in the resource search field, and click on 'no match found'
package-lock.json Outdated Show resolved Hide resolved
@DanielC-N
Copy link
Contributor Author

@selvabenz
I've fixed the bug I've found in my modifications => e5fd90b

You can test it yourself by creating a project, with 2 different files, then navigating between the two books in the project. Now the sentences are correctly loaded.

@selvabenz
Copy link

Unable to export Juxta projects, the app is frozen during the export. All the other flavor exports well.

image

@DanielC-N
Copy link
Contributor Author

@selvabenz FIX for the export (and import) problem : b4d8e3c
It now works properly.

@selvabenz
Copy link

@selvabenz FIX for the export (and import) problem : b4d8e3c It now works properly.

Will check and respond soon @DanielC-N

@selvabenz
Copy link

@DanielC-N i am facing a problem in the OBS mode, while the project is exported there is no project as zip checkbox visible but it is exporting the project as a zip file.

Note: In the dev branch project as zip only assigned to text translation

@DanielC-N
Copy link
Contributor Author

DanielC-N commented May 30, 2024

@selvabenz I've fixed the problem here : 3dda2e5

I did modify this behavior without noticing the change for obs. In the long run, I think this part of the code could use some refactorisation.

@selvabenz
Copy link

selvabenz commented May 31, 2024

@DanielC-N Sounds good! thanks for the fix.

@vipinpaul they did not do the CSS fix on the create project button and the spinner @joelthe1 this PR can be merged.

@selvabenz
Copy link

@vipinpaul and @joelthe1 this PR can be merged. all the asked CSS fix have been made.

@vipinpaul vipinpaul merged commit 2c83c31 into bible-technology:development Jun 14, 2024
2 checks passed
vipinpaul pushed a commit that referenced this pull request Jun 14, 2024
* - added a Juxta mode that creates a translation burrito
- added a 'factoryCreateContent.js'  file to help factorize some code for 'createObsContent', 'createVersificationUSFM' and 'createAudioVersification' in 'saveProjetcsMeta.js'

- fixing some typos, fixing lint

* Refactorization of 'saveProjectsMeta.js'

* Scripture Burrito as a resource : added the poissibility for the user to search and download a SB as a resource in a module

* removed checkbox from the UI and query sb resource everytime

* Added a juxtalinear editor along with a new mode.
- auto load a book on the opening of a project
- auto save after a modification
- fixed a bit of typos and code

* created a juxtaBurrito creator and a function to add juxta content. Also edited the icon for Juxta mode (it's visible now) you can create a new juxta project

* ADDED juxta support for SB creation and fixed some typos

* ADDED support for usfm import for a juxta project. Now we have to change the way a juxta json is built.

* juxtalineat mode functionnal

* UPDATE : now the interface handle corectly a json juxta file and update it if needed. and layout color update

* function to update a json juxta file if needed

* checksums ok for each modifications of the juxta

* bugfix : juxta was still using a translation settings

* quick fix

* added new kewboard shortcuts : 'Tab' to navigate through line chuncks, 'double click' to modify a chunck, 'enter' to end the modification of a chunck. And added seemless navigation between Juxtalinear editor and the BibleEditorX. Navigating through verses and chapters with the menu bar will load the corresponding sentence and vice versa.

* removing a useless 'console.log'

* FIXED font size when aditing a chunck, ADDED a bit of css and added a skip for the liter for .ts files

* I put the sentences loading one layer outside the main editor, to avoid the editor to re-render everytime the juxtalinear editor module

* Many bugfixes #303 (comment)

* add a check if the folder exists

* added a little bit of secure code for OBS loading

* changed the behavior of the Snackbar. If error === 'failure' the snackbar will show up for a longer time

* changed the behavior of the Snackbar. If error === 'failure' the snackbar will show up for a longer time

* bold text 'CREATE PROJECT' for better visibility and start to check 'canonSpecification' for a juxta project

* added the feature that download resources not imported by the user for juxtalinear project

* Now the user is correctly notified when the imported books does not match the canon specification, and also, the canon specification automatically matches the file imported

* minor bugfixes and code cleaning

* changed place of the 'nprogress' by few px

* added a better user-friendly messages to nugde the user to import at least one resource for a Juxtalinear project

* FIXED : archive a Text Translation project OK.

* star/unstar a juxtalinear project works now

* FIX : bug that prevented some resources to show up. and FIX : bug that was throwing an error when a user where to search for a resource in the resource search field, and click on 'no match found'

* deleted package-lock.json and updated yarn.lock

* updated french translation

* bugfix : you can now edit a juxta project properly

* fixed bug where on book change, the sentences where wronly saved under another filename

* make 'jsonFileContent.bookCode' to upper case for safety reasons

* FIX : export/import now works properly for juxtalinear projects

* fix obs auto zipping on export

* spinner and 'create project' button css fix.

* 'create project' button reverted

* fixed most of the lint errors. It leaves the 'control label errors' and one nested ternary operation here : 'renderer/src/components/EditorPage/Reference/OBS/ObsTn.js' line 147

* lint fixes until 'labels missing'

* removed useless file

* removed a comment

---------

Co-authored-by: danielc-n <[email protected]>
vipinpaul pushed a commit that referenced this pull request Sep 12, 2024
* - added a Juxta mode that creates a translation burrito
- added a 'factoryCreateContent.js'  file to help factorize some code for 'createObsContent', 'createVersificationUSFM' and 'createAudioVersification' in 'saveProjetcsMeta.js'

- fixing some typos, fixing lint

* Refactorization of 'saveProjectsMeta.js'

* Scripture Burrito as a resource : added the poissibility for the user to search and download a SB as a resource in a module

* removed checkbox from the UI and query sb resource everytime

* Added a juxtalinear editor along with a new mode.
- auto load a book on the opening of a project
- auto save after a modification
- fixed a bit of typos and code

* created a juxtaBurrito creator and a function to add juxta content. Also edited the icon for Juxta mode (it's visible now) you can create a new juxta project

* ADDED juxta support for SB creation and fixed some typos

* ADDED support for usfm import for a juxta project. Now we have to change the way a juxta json is built.

* juxtalineat mode functionnal

* UPDATE : now the interface handle corectly a json juxta file and update it if needed. and layout color update

* function to update a json juxta file if needed

* checksums ok for each modifications of the juxta

* bugfix : juxta was still using a translation settings

* quick fix

* added new kewboard shortcuts : 'Tab' to navigate through line chuncks, 'double click' to modify a chunck, 'enter' to end the modification of a chunck. And added seemless navigation between Juxtalinear editor and the BibleEditorX. Navigating through verses and chapters with the menu bar will load the corresponding sentence and vice versa.

* removing a useless 'console.log'

* FIXED font size when aditing a chunck, ADDED a bit of css and added a skip for the liter for .ts files

* added juxtalinear alignment editor

* added prototype of Grammateus

* added release for win64

* to the point it works in scribe

* checkpoint for juxtaligner

* base code for pdf print

* UPDATE succesful. we also save ne more option to the settings file of the user : to know if the help pop has already been opened once

* removed useless comments and log

* removed useless comments and log

* added markdown rendering for juxtalign editor and fix #6

* Do print modal
zoom on pdf
2 sections for prints
font size, paper size, font familly selection
restyling of original modal

* I put the sentences loading one layer outside the main editor, to avoid the editor to re-render everytime the juxtalinear editor module

* do uninstall wrong pdf-react

* added basecode for bouquet picker

* base for Scripture content picker

* 'it works' version of scriptureContentPicker in scribe, with a button to open the popup example

* do sortableList
do accordion in sortableList
do select new option for sortable list

* do UwCommit for presentation
do css merge

* do add hiroshi componenent

* now hiroshi's module is nice and clean. Scribe also have 'listResourcesForPdf' as the json list for the module to list resources

* added a search bar and bugfixes

* hid the 'Korennummi' and 'Word' tabs

* added functions to parse burrito resources

* Many bugfixes #303 (comment)

* add a check if the folder exists

* added a little bit of secure code for OBS loading

* changed the behavior of the Snackbar. If error === 'failure' the snackbar will show up for a longer time

* changed the behavior of the Snackbar. If error === 'failure' the snackbar will show up for a longer time

* do add picker for scriptures in pdf

* bold text 'CREATE PROJECT' for better visibility and start to check 'canonSpecification' for a juxta project

* added the feature that download resources not imported by the user for juxtalinear project

* ajout ScriptureContentSarchBar en module simple à utiliser

* added jxl-pdf as dependencies and an example with '4ColumnSpread'

* do specification picker

* succesfully imported jxl-pdf

* Now the user is correctly notified when the imported books does not match the canon specification, and also, the canon specification automatically matches the file imported

* minor bugfixes and code cleaning

* changed place of the 'nprogress' by few px

* do finish print data setter

* added a better user-friendly messages to nugde the user to import at least one resource for a Juxtalinear project

* FIXED : archive a Text Translation project OK.

* star/unstar a juxtalinear project works now

* merge 2

* FIX : bug that prevented some resources to show up. and FIX : bug that was throwing an error when a user where to search for a resource in the resource search field, and click on 'no match found'

* deleted package-lock.json and updated yarn.lock

* updated french translation

* add wrappers

* 1/2 do figma revamp

* bugfix : you can now edit a juxta project properly

* fixed bug where on book change, the sentences where wronly saved under another filename

* make 'jsonFileContent.bookCode' to upper case for safety reasons

* FIX : export/import now works properly for juxtalinear projects

* interface, first draft kitchen faucet

* added global.PdfGen directly into the code

* first stage of clean up of code en refactor style

* second commit structure and refactor code, merge pdfGen, usePdfGen signature for section creation

* some adjustment of ui, Json validation for Print button

* fixed some horrible indent

* fix obs auto zipping on export

* spinner and 'create project' button css fix.

* 'create project' button reverted

* pdfGen working interface with obs

* technical demo pdfgen wip

* fixed most of the lint errors. It leaves the 'control label errors' and one nested ternary operation here : 'renderer/src/components/EditorPage/Reference/OBS/ObsTn.js' line 147

* lint fixes until 'labels missing'

* removed useless file

* removed a comment

* updated yarn lock and deps

* no more error with big pdf

* updated packages

* bug fixes, by project print

* deleted useless files

* deleted useless files

* remove me file

* select options defaults

* little changes

* for PR change
add error in user consol when print fail
change logic for book select in bcvWrapper
4 - 2 column spread work
4 -2 column and other are now only selectable in advance mode
close pdf modal with button
change export file name
other small changes

* rollback package.json

* update yarn lock

* bug fixes

* pdf-gen updata

* removed 'korennumi' and 'word' tabs

* changed jxl-pdf version

* updated packages

* indentation fixes

* updated jxl and updated the code to work with juxta

* add last changes for PDF print.

* removed juxtalign mode and bugfix : #357 => #357

* trying to increase ulimit

* installing distutils setuptools directly from brew for mac machine

* installing python-setuptools

* dist : release error

* trying a configuration to increase 'maxConcurrentTasks'

* removed @mui/icons-react from deps and let it in devDeps

* updated jxl-pdf

* correction of code

* increased maxfiles form kernel directly

* updated actions/upload-artifact@v1 to v4

* trying kern.maxfiles=10485760 with sudo

* the mac build take too much time for yarn install v1.22.19
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.65s. so I'm trying to make it verbose to detect the problem. Also, I authorized the overwrite of the artifacts

* removed some useless 'console.log' and changed the name of the artifacts to avoid error within github actions

* updated jxl-pdf

* working reset button

* changes for : #361 (comment)

* hide the print button on audio projects

---------

Co-authored-by: danielc-n <[email protected]>
Co-authored-by: Aillet Gabriel <[email protected]>
Co-authored-by: gabrielaillet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants